let express = require('express');
let path = require('path');

let app = express();
// 托管static文件夹
app.use('/static',express.static('static'));

app.get('/',(req,res) => {
    console.log(req.url);
    res.sendFile(path.join(__dirname,'index.html'))
})

app.post('/index',(req,res) => {
    res.send('post请求')
})

app.listen(8004,() => {
    console.log('服务器运行在localhost8004端口上');
})